const { asValue } = require('awilix')

module.exports =
  ({}) =>
  (req, res, next) => {
    const tokenHeader = req.header['authorization'] || ''

    req.container.register({
      currentUser: asValue(req.user),
    })
    return next()
  }
